home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / dvx / inc / x11 / xmu / displayq.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  2.7 KB  |  87 lines

  1. /* Coopyright 1989 Massachusetts Institute of Technology */
  2.  
  3. #include <X11/Xmu/CloseHook.h>
  4.  
  5. /*
  6.  *                  Public Entry Points
  7.  * 
  8.  * 
  9.  * XmuDisplayQueue *XmuDQCreate (closefunc, freefunc, data)
  10.  *     int (*closefunc)();
  11.  *     int (*freefunc)();
  12.  *     caddr_t data;
  13.  * 
  14.  *         Creates and returns a queue into which displays may be placed.  When
  15.  *         the display is closed, the closefunc (if non-NULL) is upcalled with
  16.  *         as follows:
  17.  *
  18.  *                 (*closefunc) (queue, entry)
  19.  *
  20.  *         The freeproc, if non-NULL, is called whenever the last display is
  21.  *         closed, notifying the creator that display queue may be released
  22.  *         using XmuDQDestroy.
  23.  *
  24.  *
  25.  * Bool XmuDQDestroy (q, docallbacks)
  26.  *     XmuDisplayQueue *q;
  27.  *     Bool docallbacks;
  28.  * 
  29.  *         Releases all memory for the indicated display queue.  If docallbacks
  30.  *         is true, then the closefunc (if non-NULL) is called for each 
  31.  *         display.
  32.  * 
  33.  * 
  34.  * XmuDisplayQueueEntry *XmuDQLookupDisplay (q, dpy)
  35.  *     XmuDisplayQueue *q;
  36.  *     Display *dpy;
  37.  *
  38.  *         Returns the queue entry for the specified display or NULL if the
  39.  *         display is not in the queue.
  40.  *
  41.  * 
  42.  * XmuDisplayQueueEntry *XmuDQAddDisplay (q, dpy, data)
  43.  *     XmuDisplayQueue *q;
  44.  *     Display *dpy;
  45.  *     caddr_t data;
  46.  *
  47.  *         Adds the indicated display to the end of the queue or NULL if it
  48.  *         is unable to allocate memory.  The data field may be used by the
  49.  *         caller to attach arbitrary data to this display in this queue.  The
  50.  *         caller should use XmuDQLookupDisplay to make sure that the display
  51.  *         hasn't already been added.
  52.  * 
  53.  * 
  54.  * Bool XmuDQRemoveDisplay (q, dpy)
  55.  *     XmuDisplayQueue *q;
  56.  *     Display *dpy;
  57.  *
  58.  *         Removes the specified display from the given queue.  If the 
  59.  *         indicated display is not found on this queue, False is returned,
  60.  *         otherwise True is returned.
  61.  */
  62.  
  63. typedef struct _XmuDisplayQueueEntry {
  64.     struct _XmuDisplayQueueEntry *prev, *next;
  65.     Display *display;
  66.     CloseHook closehook;
  67.     caddr_t data;
  68. } XmuDisplayQueueEntry;
  69.  
  70. typedef struct _XmuDisplayQueue {
  71.     int nentries;
  72.     XmuDisplayQueueEntry *head, *tail;
  73.     int (*closefunc)(struct _XmuDisplayQueue *,struct _XmuDisplayQueueEntry * /* POHC 91/04/16 */);
  74.     int (*freefunc)(struct _XmuDisplayQueue * /* POHC 91/04/16 */);
  75.     caddr_t data;
  76. } XmuDisplayQueue;
  77.  
  78.  
  79. extern XmuDisplayQueue *XmuDQCreate ();
  80. extern Bool XmuDQDestroy ();
  81. extern XmuDisplayQueueEntry *XmuDQLookupDisplay ();
  82. extern XmuDisplayQueueEntry *XmuDQAddDisplay ();
  83. extern Bool XmuDQRemoveDisplay ();
  84.  
  85.  
  86. #define XmuDQNDisplays(q) ((q)->nentries)
  87.